package com.ruoyi.fapp.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.fapp.service.AppChatMsgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/app/chat")
public class AppChatMsgController extends BaseController {



    @Autowired
    AppChatMsgService appChatMsgService;

    //获取聊天列表
    @GetMapping("/getChatList/{userId}")
    public AjaxResult getChatList(@PathVariable Integer userId) {

        return AjaxResult.success(appChatMsgService.getChatList(userId));
    }


    //删除某个聊天记录
    @PostMapping("/deleteChat")
    public AjaxResult deleteChat(String chatId) {

        appChatMsgService.deleteChat(chatId);

        return AjaxResult.success();
    }


    //获取聊天内容
    @PostMapping("/getChatContent")
    public AjaxResult getChatContent(String chatId) {
        appChatMsgService.getChatContent(chatId);
        return AjaxResult.success();
    }







}
